package com.example.blogapi;

import com.example.blogapi.config.TestConfig;
import com.example.blogapi.controller.ArticleController;
import com.example.blogapi.domain.MsArticle;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

//@MapperScan("com.example.blogapi.mapper.*")
@SpringBootApplication
public class BlogApiApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(BlogApiApplication.class, args);
        String[] names = run.getBeanDefinitionNames();
        for (String name : names) {
            System.out.println(name);
        }
//        MsArticle articlePojo1 = run.getBean("getArticlePojo", MsArticle.class);
//        MsArticle articlePojo2 = run.getBean("getArticlePojo", MsArticle.class);
//        TestConfig testConfig = run.getBean("testConfig", TestConfig.class);
//        ArticleController articleController = run.getBean("articleController", ArticleController.class);
//        System.out.println(testConfig);
//        System.out.println(articlePojo1==articlePojo2);
//        MsArticle articlePojo3 = testConfig.getArticlePojo();
//        System.out.println(articlePojo1==articlePojo3);
//        System.out.println("========================");
//        System.out.println(articleController.getClass());
//        System.out.println(articlePojo1.getClass());
//        System.out.println(articlePojo2.getClass());
//        System.out.println(articlePojo3.getClass());
//        System.out.println("===================");


    }

}
